﻿using ControlHelper.Attributes;
using System;

namespace Creator.Core.Entity
{
    public class belt_floor_table : ViewModelBase
    {
        public override int IdHashCode => string.IsNullOrWhiteSpace(work_id) ? 0 : work_id.GetHashCode(); 
        public override string Name => work_id;
        public override string Description => $"{load_info1}:{load_staus}";
        public override double Width => pos_width;
        public override double Height => pos_height; 
        public override double PosX => pos_x; 
        public override double PosY => pos_y;

        private string realTimeInfo;
        public override string RealTimeInfo
        {
            get => $"{work_name}_{load_info1}:{load_staus}"; set
            {

                realTimeInfo = value;
                RaisePropertyChanged();
            }
        }


        [Label]                                                                                                
        public string work_id
        {
            get => _work_id;
            set
            {
                _work_id = value;                                                                                                                                                                
                RaisePropertyChanged();
            }
        }
        private string _work_id;

        [Label]
        public int pos_x
        {
            get => _pos_x;
            set
            {
                _pos_x = value;
                RaisePropertyChanged();
            }
        }
        private int _pos_x;

        [Label]
        public int pos_y
        {
            get => _pos_y;
            set
            {
                _pos_y = value;
                RaisePropertyChanged();
            }
        }
        private int _pos_y;

        [Label]
        public int pos_width
        {
            get => _pos_width;
            set
            {
                _pos_width = value;
                RaisePropertyChanged();
            }
        }
        private int _pos_width;

        [Label]
        public int pos_height
        {
            get => _pos_height;
            set
            {
                _pos_height = value;
                RaisePropertyChanged();
            }
        }
        private int _pos_height;

        [Label]
        public int row_index
        {
            get => _row_index;
            set
            {
                _row_index = value;
                RaisePropertyChanged();
            }
        }
        private int _row_index;

        [Label]
        public int x_index
        {
            get => _x_index;
            set
            {
                _x_index = value;
                RaisePropertyChanged();
            }
        }
        private int _x_index;

        [Label]
        public int y_index
        {
            get => _y_index;
            set
            {
                _y_index = value;
                RaisePropertyChanged();
            }
        }
        private int _y_index;

        [Label]
        public int floor_type
        {
            get => _floor_type;
            set
            {
                _floor_type = value;
                RaisePropertyChanged();
            }
        }
        private int _floor_type;

        [Label]
        public int? work_name_id
        {
            get => _work_name_id;
            set
            {
                _work_name_id = value;
                RaisePropertyChanged();
            }
        }
        private int? _work_name_id;

        [Label]
        public string work_name
        {
            get => _work_name;
            set
            {
                RealTimeInfo = null;
                _work_name = value;
                RaisePropertyChanged();
            }
        }
        private string _work_name;

        [Label]
        public string load_info1
        {
            get => _load_info1;
            set
            {
                _load_info1 = value;
                RaisePropertyChanged();
            }
        }
        private string _load_info1;

        [Label]
        public int load_staus
        {
            get => _load_staus;
            set
            {
                _load_staus = value;
                RaisePropertyChanged();
            }
        }
        private int _load_staus;

        [Label]
        public int work_staus
        {
            get => _work_staus;
            set
            {
                _work_staus = value;
                RaisePropertyChanged();
            }
        }
        private int _work_staus;

        [Label]
        public int plc_have
        {
            get => _plc_have;
            set
            {
                _plc_have = value;
                RaisePropertyChanged();
            }
        }
        private int _plc_have;

        [Label]
        public int plc_next_work_id
        {
            get => _plc_next_work_id;
            set
            {
                _plc_next_work_id = value;
                RaisePropertyChanged();
            }
        }
        private int _plc_next_work_id;

        [Label]
        public int plc_move_req
        {
            get => _plc_move_req;
            set
            {
                _plc_move_req = value;
                RaisePropertyChanged();
            }
        }
        private int _plc_move_req;

        [Label]
        public int plc_sacn_req
        {
            get => _plc_sacn_req;
            set
            {
                _plc_sacn_req = value;
                RaisePropertyChanged();
            }
        }
        private int _plc_sacn_req;
          
        [Label]
        public int plc_get_put_req
        {
            get => _plc_get_put_req;
            set
            {
                _plc_get_put_req = value;
                RaisePropertyChanged();
            }
        }
        private int _plc_get_put_req;

        [Label]
        public int plc_get_put_ans
        {
            get => _plc_get_put_ans;
            set
            {
                _plc_get_put_ans = value;
                RaisePropertyChanged();
            }
        }
        private int _plc_get_put_ans;

        [Label]
        public DateTime update_time
        {
            get => _update_time;
            set
            {
                _update_time = value;
                RaisePropertyChanged();
            }
        } 
        private DateTime _update_time;
    }

}
